import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    //默认跳登录页面
    {
      path: '/',
      redirect:'/login'
    },
    //登录
    {
      path: '/login',
      name: 'login',
      component: () => import('./views/login/login.vue')
    },
    //主界面的功能
    {
      path:'/index',
      name:'index',
      component:()=>import('./components/system-8100/index.vue'),


      //接下来是子功能的路由配置
      children:[
        //仓库管理
        {
          path:'/Repertory',
          name:'Repertory',
          component:()=>import('./components/inventory-8500/Repertory.vue')
        },
        //入库管理
        {
          path:'/storages',
          name:'storages',
          component:()=>import('./components/inventory-8500/storages.vue')
        },
        //出库管理
        {
          path:'/Outbound',
          name:'Outbound',
          component:()=>import('./components/inventory-8500/Outbound.vue')
        },
        //系统管理
        {
          path: '/users',
          name: 'users',
          component: () => import('./components/system-8100/users.vue')
        },
        {
          path: '/userRole',
          name: 'userRole',
          component: () => import('./components/system-8100/userRole.vue')
        },
        //财务管理
        {
          path: '/FinancialRevenue',
          name: 'FinancialRevenue',
          component: () => import('./components/finance-8400/FinancialRevenue.vue')
        },
        {
          path: '/FiscalExpenditure',
          name: 'FiscalExpenditure.vue',
          component: () => import('./components/finance-8400/FiscalExpenditure.vue')
        },
        //销售管理
        {
          path: '/salesOrder',
          name: 'salesOrder',
          component: () => import('./components/sell-8300/salesOrder.vue')
        },
        //采购管理
        {
          path: '/purchasePlan',
          name: 'purchasePlan',
          component: () => import('./components/purchase-8200/purchasePlan.vue')
        },
      ]
    }

  ]
})
